package com.ecity.table 
{
	import com.ecity.util.UIFactory;
	import flash.display.MovieClip;
	import flash.display.Sprite;
	
	/**
	 * ...
	 * @author yicheng.zhang
	 */
	public class ProgressBar extends Sprite {
		private var progressbar:MovieClip;
		private var isFetched:Boolean = false;
		
		public function ProgressBar(){
			progressbar = new MovieClip();
		}
		
		public function update(rate:Number):void {
			if (!isFetched) {
				trace("progressbar : ",UIFactory.uimap.keys());
				progressbar = UIFactory.getMcbyName("progressbar") as MovieClip;
				isFetched = true;
			}
			if (!this.contains(progressbar)) {
				this.addChild(progressbar);
			}
			progressbar.gotoAndStop(int(rate));
		}
		
	}

}